import java.io.*;
//import java.io.BufferedReader;
//import java.io.FileWriter;
//import java.io.FileReader;
//import java.util.StringTokenizer;
import java.util.*;
import java.lang.Math;
import java.lang.Integer;


public class Col{
	public static void main(String[] args){
		BufferedReader file = null;
		String nombrePlaneta;
		int p1;
		int p2;
		int p3;
		boolean tieneAguaPlaneta;
		String line;
		Planeta listaPlanetas[];
		int i = 0;
		final int maxPlanetas = 10;
		listaPlanetas = new Planeta[maxPlanetas];

		try {
			file = new BufferedReader(new FileReader("Planetas.txt"));
			while ((line = file.readLine()) != null){
				StringTokenizer l = new StringTokenizer(line, " ");
				nombrePlaneta = l.nextToken();
				String s1 = l.nextToken();
				p1 = Integer.parseInt(s1);
				String s2 = l.nextToken();
				p2 = Integer.parseInt(s2);
				String s3 = l.nextToken();
				p3 = Integer.parseInt(s3);
				tieneAguaPlaneta = l.nextToken().equals("true");
				if (i <= maxPlanetas){

					listaPlanetas[i] = new Planeta(tieneAguaPlaneta, p1, p2, p3, nombrePlaneta);
					i++;
				}
			}
		}
		catch (IOException ex){
			System.out.println("Error de ejecución"+ex.toString());
			System.exit(1);

		};

		Arrays.sort(listaPlanetas);

		for (int j = 0; j < maxPlanetas; j++){
			System.out.println ("Array has been sorted");
			System.out.println ("Planeta"+j+"se llama"+listaPlanetas[j].getNombrePlaneta());
		}

	}
}
